<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><%= title %></title>
</head>
<link rel="stylesheet" href="/stylesheets/record.css">
<link rel="stylesheet" href="/stylesheets/nav.css">
<body>
<div class="head"><p><%= title %></p></div>
<hr>
<nav id="record_nav">
    <form class="nav_button" action="/record" method="get" enctype="multipart/form-data">
        <input type="submit" value="联系作者">
    </form>
    <div class="linear"></div>
    <form class="nav_button" action="/exit" method="post" enctype="multipart/form-data">
        <input type="submit" value="退出登录">
    </form>
</nav>
<!--列表渲染(数组遍历)-->
<% accounts.forEach(item =>{ %>
    <div class="record">
        <div class="message">
            <div class="message_box1 <%= item.type==="支出" ? "expenditure":"income" %>"><span><%= moments(item.time).format('YYYY-MM-DD') %></span></div>
            <div class="message_body">
                <div><span><%= item.matter %></span></div>
                <div class="type <%= item.type==="支出" ? "type_expenditure":"type_income" %>"><span><%= item.type %></span></div>
                <div><span><%= item.money %>元</span></div>
                <div class="button"><a class="ask" href="/record/<%= item._id %>">删除</a></div>
            </div>
        </div>
    </div>
<% }) %>
<div class="button_create"><a href="/create">添加记录</a></div>
<script src="/javascripts/record.js"></script>
</body>
</html>